#!/usr/bin/python3
# -*- coding: utf-8 -*-
import pymysql


def connect_mysql():
    host = "gz-cdb-dh9gjrux.sql.tencentcdb.com"
    port = 61369
    user = "buyanlei"
    pwd = "0jAs0nE9"
    dbname = "vending_machine"
    db = pymysql.connect(host, port, dbname, user, pwd)
    cursor = db.cursor()
    sql = "SELECT freeze_sku FROM supply_channel WHERE device_id='145' AND freeze_sku>0"
    cursor.execute(sql)
    result = cursor.fetchall()
    print(result)


connect_mysql()
